<template>
  <div class="complaint-info">
    <el-scrollbar class="scroll-wrapper">
      <div class="content">
        <div class="section-title">基本信息</div>
        <div class="list-con">
          <div class="li">
            <div class="li-key">政策名称</div>
            <div class="li-val">{{ comInfo.policyName }}</div>
          </div>
          <div class="li">
            <div class="li-key">发文文号</div>
            <div class="li-val">{{ comInfo.policyName }}</div>
          </div>
          <div class="li">
            <div class="li-key">适用企业类型</div>
            <div class="li-val">{{ enterpriseType(comInfo.suitEnterpriseTypeList) }}</div>
          </div>
          <div class="li">
            <div class="li-key">政策主题</div>
            <div class="li-val">{{ policyTitle(comInfo.policyTitleList) }}</div>
          </div>
          <div class="li">
            <div class="li-key">政策详情</div>
            <div class="li-val">
              <div v-html="comInfo.policyContent"></div>
            </div>
          </div>
          <div class="li">
            <div class="li-key">原文链接</div>
            <div class="li-val">
              <a class="url" :href="comInfo.originalLink" target="_blank">{{ comInfo.originalLink }}</a>
            </div>
          </div>
          <div class="li" v-if="false">
            <div class="li-key">附件信息</div>
            <div class="li-val"><UploadPreview :fileList="[]" :showDelete="false" layout="list"></UploadPreview></div>
          </div>
          <div class="li">
            <div class="li-key">发文日期</div>
            <div class="li-val">{{ comInfo.publishDate }}</div>
          </div>
        </div>
      </div>
    </el-scrollbar>
  </div>
</template>

<script>
import UploadPreview from '@com/UploadPreview'
export default {
  components: { UploadPreview },
  props: {
    comInfo: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {}
  },
  computed: {
    enterpriseType() {
      return data => {
        if (data && data.length) {
          return data.map(item => item.relTypeName).join('、')
        } else {
          return ''
        }
      }
    },
    policyTitle() {
      return data => {
        if (data && data.length) {
          return data.map(item => item.relTypeName).join('、')
        } else {
          return ''
        }
      }
    },
  },
  created() {},
  methods: {},
}
</script>

<style lang="scss" scoped>
@import '@styles/detailsTable.scss';
.complaint-info {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  .scroll-wrapper {
    flex: 1;
  }
  .content {
    padding: 20px;

    .section-title {
      font-size: 16px;
      color: #333;
      font-weight: bold;
      margin-bottom: 15px;
      padding-left: 15px;
      border-left: 3px solid #3b93f7;
    }
  }
}
</style>
